package com.god.dumper;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.god.analyser.FieldCollector;
import com.god.visual.node.ImageNode;
import com.god.visual.node.DumperNode;
import com.god.visual.node.NodeFactory;

public class DumpManager {
	
	//itself, children,parent
	public static void dumpAll(Object o){
		//dump(o,"dd");
	}

	//itself and down
	public static void dumpDown(Object o){
	//	dump(o,"dd");
	}

	public static void dump(List<Object> arrayOfObjects, String some_other_stuff){
		List nodes = new ArrayList();//nodes can be image files or java2d shapes or ...depending on implementation

		//GraphFactory graphFactory = new GraphFactory(arra);
		//Graph g = graphFactory.getGraph();
		
		NodeFactory nodeFactory = new NodeFactory();
		DumperNode ng = nodeFactory.getNode();
		long nodeName = 1;
		for(Object obj : arrayOfObjects){
			//TODO need a better strategy for node naming
			nodeName = nodeName + 1;
			//a map is just for one node
			Map<String,Object> fieldMap = FieldCollector.getFieldsMap(obj);
			nodes.add(ng.createNode(fieldMap,nodeName + "" ));
		}
	}
	
}
